package org.grow.jssp.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import java.time.LocalDateTime;

/**
 * @Author: xwg
 * @CreateDate: 2022/3/10
 */

@Controller
public class FooController {
    @GetMapping("/testAjax")
    @ResponseBody
    public String testAjax(){
        return LocalDateTime.now().toString();
    }
    @GetMapping("/testMvc")
    public ModelAndView testMvc(){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("welcoming");
        modelAndView.addObject("goods","nice to see you");
        return modelAndView;
    }
}
